#include "stdio.h"
#include "stdlib.h"

int max(int, int);
int min(int, int);
int getVal(int, int, int(*)(int, int));

int main()
{
    int a = 10, b = 20;
    int c;

    c = getVal(a, b, max);
    printf("max = %d\n", c);

    c = getVal(a, b, min);
    printf("min = %d\n", c);

    return 0;
}

int max(int x, int y)
{
    return x > y ? x : y;
}

int min(int x, int y)
{
    return x < y ? x : y;
}

int getVal(int x, int y, int (*pf)(int, int))
{
    return pf(x, y);
}
